package com.yhcnet.blog.service;

import com.yhcnet.blog.dao.WordMapper;
import com.yhcnet.blog.pojo.Word;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WordService {

    @Autowired
    WordMapper wordMapper;

    public synchronized boolean say(Word word){
        int say = wordMapper.say(word);
        if(say > 0) return true;
        return false;
    }

    public synchronized boolean detele(int WID){
        int delete = wordMapper.delete(WID);
        if(delete > 0) return true;
        return false;
    }

    public List<Word> gertW(){
        return wordMapper.getW();
    }
}
